<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <script type="text/javascript" src="${ctx}/appjs/acct/acctTenantOperatorElecStation.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">运营商</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>分销商列表</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>站点列表</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg elecStationBody">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input name="tenantOperatorCode" id="tenantOperatorCode" value="${tenantOperatorCode}"
                           type="hidden">
                    <input id="stationName" name="stationName" type="text"
                           class="form-control shortInput input-distance"
                           placeholder="站点名称">
                    <input id="startTime" name="startTime" type="text" readonly
                           class="form-control shortInput input-distance"
                           placeholder="规则开始时间">
                    <input id="endTime" name="endTime" type="text" class="form-control shortInput input-distance"
                           readonly
                           placeholder="规则结束时间">
                    <button class="btn btn-success input-distance" onclick="acctTenantOperatorElecStation.reLoad()">查询
                    </button>
                    <button type="button" class="btn btn-success marginright-auto input-distance"
                            onclick="acctTenantOperatorElecStation.exportAcctTenantOperatorElecStation()">
                        导出</button>
                </div>
            </div>
            <table id="exampleTable" data-mobile-responsive="true">
            </table>

            <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                 aria-labelledby="exampleModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true"></span></button>
                            <h4 class="modal-title" id="exampleModalLabel" data-dismiss="modal" aria-label="Close">
                                关闭</h4>
                        </div>
                        <div class="modal-body">
                            <form id="contentForm" class="layui-form">
                                <div class="form-group row changeline">
                                    <label class="col-sm-3 col-form-label text-right">账单时间:</label>
                                    <div class="col-sm-9">
                                        <input id="billStartTime" name="billStartTime" type="text" readonly
                                                   class="billchange"
                                                   placeholder="开始时间" style="display: inline-block;width: 118px">&nbsp;~&nbsp;
                                        <input id="billEndTime" name="billEndTime" type="text" class="billchange"
                                                      readonly style="display: inline-block;width: 118px"
                                                      placeholder="结束时间">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-right">电费:</label>
                                    <div class="col-sm-8">
                                        <input type="number" style="text-align: center" id="billTotalElecMoney" name="billTotalElecMoney" onchange="checkMoney()" step="0.01">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-right">服务费:</label>
                                    <div class="col-sm-8">
                                        <input type="number" style="text-align: center" id="billTotalSeviceMoney" name="billTotalSeviceMoney" onchange="checkMoney()" step="0.01">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-right">总金额:</label>
                                    <div class="col-sm-8">
                                        <input type="text" style="text-align: center" id="billTotalMoney" name="billTotalMoney" readonly>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-right">说明:</label>
                                    <div class="col-sm-8">
                                        <textarea style="width: 100%" rows="5" id="supplyRemark" name="supplyRemark"></textarea>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default cancleButton" data-dismiss="modal" id="cancle">取消</button>
                            <button type="button" class="btn btn-success" id="addAcctBillOrder">添加</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

<script type="text/javascript">

    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤


    acctTenantOperatorElecStation.init();

    var start1 = {
        elem: '#billStartTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false
    };
    var end1 = {
        elem: '#billEndTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false
    };
    laydate(start1);
    laydate(end1);
    laydate.skin('molv');//皮肤

    //总金额
    function checkMoney() {
        var billTotalElecMoney=$("#billTotalElecMoney").val();
        var billTotalSeviceMoney=$("#billTotalSeviceMoney").val();
        // alert("elecMoney:"+billTotalElecMoney+",serviceMoney:"+billTotalSeviceMoney);
        if (billTotalElecMoney!=''&&billTotalSeviceMoney!=''){
            $("#billTotalMoney").val((parseFloat(billTotalElecMoney)+parseFloat(billTotalSeviceMoney)).toFixed(2));
        }else if (billTotalElecMoney==''&&billTotalSeviceMoney!=''){
            $("#billTotalMoney").val(parseFloat(billTotalSeviceMoney).toFixed(2));
        }else if (billTotalSeviceMoney==''&&billTotalElecMoney!=''){
            $("#billTotalMoney").val(parseFloat(billTotalElecMoney).toFixed(2));
        }else {
            $("#billTotalMoney").val('0');
        }
    }
</script>
</body>
</html>